package java115.Thread;
//继承 Thread, 重写 run, 使用匿名内部类
public class Demo3 {
    public static void main(String[] args) {
        Thread t1 = new Thread() {
            @Override
            public void run() {
                for (int i = 0; i < 5; i++) {
                    System.out.println(Thread.currentThread().getName() + " is running");
                } 
        }
    };
    t1.start();
    


    //主线程
    for (int i = 0; i < 5; i++) {
        System.out.println(Thread.currentThread().getName() + " is running");
    }
}    
}
